Topic: Auto mileage
Points: 25
Instructor:
Turn In: C++
Files
Auto.h, Auto.cpp and
Assignment1.cpp on
C#
Files
Auto.cs and Assignment1.cs
Java
Files
Auto.java and Assignment1.java
C# and Java Console Help From McCown
Expected review Material:
Given general automobile specifications, this application will keep track of remaining fuel, trip miles, and total miles.
File
Name: Auto.h
Use
Compiler Directives to keep CAuto from possibly being
defined twice.
Filename:
Auto.cpp, Auto.cs, Auto.java
CAuto() – the default constructor for the CAuto class should request from the user initial values for each of the member variables. You may format this as you wish but the information must be entered in the order shown below.
Please enter the following auto information:
Make >Ford
Model >F-150
Year >89
Total Miles on Automobile >58000
Miles Per Gallon >22
Maximum Gallons Of Fuel In Tank >30
Gallons Of Fuel In Tank >10
void Drive(float Miles = 1) – will move the car the specified number of miles. The total miles should be updated as well as the gallons of fuel in the tank. The drive function will be called with one argument in some cases and in others with no arguments.
void AddFuel() – should completely fill the fuel tank of the automobile.
void AddFuel(float GallonsAdded) - should add the specified number of gallons to the fuel tank. If the specified number of gallons cannot fit in the fuel tank, a polite error message should be presented to the user and the tank should be filled completely.
void ResetTripMeter() – Sets the trip miles to 0.
void Show() – should display all of the information about the automobile in a simple concise manor. For example:
The 89 Ford F-150 currently has:
58059 miles on the odometer,
59 miles on the trip meter,
Gets 22 Miles Per Gallon,
and has 7.31818 out of a possible 30 gallons in the Fuel tank.
.